package com.mrzhou.web.secure.auth;

import com.mrzhou.core.tool.api.CloudUser;
import com.mrzhou.core.tool.utils.StringUtil;
import com.mrzhou.web.util.WebUtil;

public class AuthFunc {

    public boolean hasRole(String... role) {
        CloudUser user = WebUtil.getUser();
        if(user == null) {
            return false;
        }
        String roleName = user.getRoleName();
        return StringUtil.contains(role, roleName);
    }

}
